1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.glib.gasyncqueue; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import core.stdc.config; 34 35 extern (C): 36 37 alias _GAsyncQueue GAsyncQueue; 38 39 struct _GAsyncQueue; 40 41 version(Derelict_Link_Static) 42 { 43 extern( C ) nothrow 44 { 45 GAsyncQueue* g_async_queue_new(); 46 GAsyncQueue* g_async_queue_new_full(GDestroyNotify item_free_func); 47 void g_async_queue_lock(GAsyncQueue* queue); 48 void g_async_queue_unlock(GAsyncQueue* queue); 49 GAsyncQueue* g_async_queue_ref(GAsyncQueue* queue); 50 void g_async_queue_unref(GAsyncQueue* queue); 51 void g_async_queue_ref_unlocked(GAsyncQueue* queue); 52 void g_async_queue_unref_and_unlock(GAsyncQueue* queue); 53 void g_async_queue_push(GAsyncQueue* queue, gpointer data); 54 void g_async_queue_push_unlocked(GAsyncQueue* queue, gpointer data); 55 void g_async_queue_push_sorted(GAsyncQueue* queue, gpointer data, GCompareDataFunc func, gpointer user_data); 56 void g_async_queue_push_sorted_unlocked(GAsyncQueue* queue, gpointer data, GCompareDataFunc func, gpointer user_data); 57 gpointer g_async_queue_pop(GAsyncQueue* queue); 58 gpointer g_async_queue_pop_unlocked(GAsyncQueue* queue); 59 gpointer g_async_queue_try_pop(GAsyncQueue* queue); 60 gpointer g_async_queue_try_pop_unlocked(GAsyncQueue* queue); 61 gpointer g_async_queue_timeout_pop(GAsyncQueue* queue, guint64 timeout); 62 gpointer g_async_queue_timeout_pop_unlocked(GAsyncQueue* queue, guint64 timeout); 63 gint g_async_queue_length(GAsyncQueue* queue); 64 gint g_async_queue_length_unlocked(GAsyncQueue* queue); 65 void g_async_queue_sort(GAsyncQueue* queue, GCompareDataFunc func, gpointer user_data); 66 void g_async_queue_sort_unlocked(GAsyncQueue* queue, GCompareDataFunc func, gpointer user_data); 67 gpointer g_async_queue_timed_pop(GAsyncQueue* queue, GTimeVal* end_time); 68 gpointer g_async_queue_timed_pop_unlocked(GAsyncQueue* queue, GTimeVal* end_time); 69 } 70 } 71 else 72 { 73 extern( C ) nothrow 74 { 75 alias da_g_async_queue_new = GAsyncQueue* function(); 76 alias da_g_async_queue_new_full = GAsyncQueue* function(GDestroyNotify item_free_func); 77 alias da_g_async_queue_lock = void function(GAsyncQueue* queue); 78 alias da_g_async_queue_unlock = void function(GAsyncQueue* queue); 79 alias da_g_async_queue_ref = GAsyncQueue* function(GAsyncQueue* queue); 80 alias da_g_async_queue_unref = void function(GAsyncQueue* queue); 81 alias da_g_async_queue_ref_unlocked = void function(GAsyncQueue* queue); 82 alias da_g_async_queue_unref_and_unlock = void function(GAsyncQueue* queue); 83 alias da_g_async_queue_push = void function(GAsyncQueue* queue, gpointer data); 84 alias da_g_async_queue_push_unlocked = void function(GAsyncQueue* queue, gpointer data); 85 alias da_g_async_queue_push_sorted = void function(GAsyncQueue* queue, gpointer data, GCompareDataFunc func, gpointer user_data); 86 alias da_g_async_queue_push_sorted_unlocked = void function(GAsyncQueue* queue, gpointer data, GCompareDataFunc func, gpointer user_data); 87 alias da_g_async_queue_pop = gpointer function(GAsyncQueue* queue); 88 alias da_g_async_queue_pop_unlocked = gpointer function(GAsyncQueue* queue); 89 alias da_g_async_queue_try_pop = gpointer function(GAsyncQueue* queue); 90 alias da_g_async_queue_try_pop_unlocked = gpointer function(GAsyncQueue* queue); 91 alias da_g_async_queue_timeout_pop = gpointer function(GAsyncQueue* queue, guint64 timeout); 92 alias da_g_async_queue_timeout_pop_unlocked = gpointer function(GAsyncQueue* queue, guint64 timeout); 93 alias da_g_async_queue_length = gint function(GAsyncQueue* queue); 94 alias da_g_async_queue_length_unlocked = gint function(GAsyncQueue* queue); 95 alias da_g_async_queue_sort = void function(GAsyncQueue* queue, GCompareDataFunc func, gpointer user_data); 96 alias da_g_async_queue_sort_unlocked = void function(GAsyncQueue* queue, GCompareDataFunc func, gpointer user_data); 97 alias da_g_async_queue_timed_pop = gpointer function(GAsyncQueue* queue, GTimeVal* end_time); 98 alias da_g_async_queue_timed_pop_unlocked = gpointer function(GAsyncQueue* queue, GTimeVal* end_time); 99 } 100 101 __gshared 102 { 103 da_g_async_queue_new g_async_queue_new; 104 da_g_async_queue_new_full g_async_queue_new_full; 105 da_g_async_queue_lock g_async_queue_lock; 106 da_g_async_queue_unlock g_async_queue_unlock; 107 da_g_async_queue_ref g_async_queue_ref; 108 da_g_async_queue_unref g_async_queue_unref; 109 da_g_async_queue_ref_unlocked g_async_queue_ref_unlocked; 110 da_g_async_queue_unref_and_unlock g_async_queue_unref_and_unlock; 111 da_g_async_queue_push g_async_queue_push; 112 da_g_async_queue_push_unlocked g_async_queue_push_unlocked; 113 da_g_async_queue_push_sorted g_async_queue_push_sorted; 114 da_g_async_queue_push_sorted_unlocked g_async_queue_push_sorted_unlocked; 115 da_g_async_queue_pop g_async_queue_pop; 116 da_g_async_queue_pop_unlocked g_async_queue_pop_unlocked; 117 da_g_async_queue_try_pop g_async_queue_try_pop; 118 da_g_async_queue_try_pop_unlocked g_async_queue_try_pop_unlocked; 119 da_g_async_queue_timeout_pop g_async_queue_timeout_pop; 120 da_g_async_queue_timeout_pop_unlocked g_async_queue_timeout_pop_unlocked; 121 da_g_async_queue_length g_async_queue_length; 122 da_g_async_queue_length_unlocked g_async_queue_length_unlocked; 123 da_g_async_queue_sort g_async_queue_sort; 124 da_g_async_queue_sort_unlocked g_async_queue_sort_unlocked; 125 da_g_async_queue_timed_pop g_async_queue_timed_pop; 126 da_g_async_queue_timed_pop_unlocked g_async_queue_timed_pop_unlocked; 127 } 128 }